#include "Player.h"

using namespace luabridge;

bool Player::RegistLuaClass(lua_State* state)
{
	getGlobalNamespace(state)
		.beginNamespace("_G")
		.deriveClass<Player, Creature>("LuaPlayer")		// 注意：派生类与非派生类区别

		.addFunction("GetChannelId", &Player::LuaGetChannelId)
		.addFunction("GetUserId", &Player::LuaGetUId)
		.addFunction("GetChannelUserName", &Player::LuaGetChannelUserName)
		.addFunction("GetAttr", &Player::LuaGetAttr)

		.endClass()
		.endNamespace();
	return true;
}

string Player::LuaGetChannelId()
{
	return "";//GetChannelId();
}

uint32_t Player::LuaGetUId()
{
	return GetUid();
}

string Player::LuaGetChannelUserName()
{
	return "";// GetChannelUserName();
}

int32_t Player::LuaGetAttr(uint32_t CANum)
{
	return GetAttr(CANum);
}